<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <input type="file" id="fileUpload">
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <script>
    /* 
      1.get请求
      2.get+params
      3.post+query
    */
    axios.get('http://myjavascript.cn/saveNum', {
      params: {
        num: 999
      }
    }).then(res => {
      console.log('响应结果：', res.data);
    })
    axios.get('http://myjavascript.cn/allNum', {
      params: {
        a: 999,
        b: 1000
      }
    }).then(res => {
      console.log('响应结果：', res.data);
    })
    axios.post('http://myjavascript.cn/leo', "user=leo&pass=123456").then(res => {
      console.log('响应结果：', res.data);
    })
    axios.all([
      axios.get('http://myjavascript.cn/saveNum', {
        params: {
          num: 999
        }
      }),
      axios.get('http://myjavascript.cn/allNum', {
        params: {
          a: 999,
          b: 1000
        }
      })
    ]).then(axios.spread(function () {
      for (let i = 0; i < arguments.length; i++) {
        const arg = arguments[i];
        console.log('请求结果：' + i, arg.data);
      }
    }))
  </script>
</body>

</html>